var Loading = {};//

var Lwidth = 0;

var Lheight = 0;

var MarginLeft = 0;

var MarginTop = 0;

Loading.Hide = function(){
	var iframe_id = "xxx_iframe";
	var div_id = "xxx_div";
	var _iframe = document.getElementById(iframe_id);
	var _div = document.getElementById(div_id);
	if(_iframe){
		_iframe.style.display='none';
	}
	if(_div){
		_div.style.display = "none";
	}
}

Loading.Show = function(option){
	var Allwidth = document.body.offsetWidth || document.documentElement.clientHeight;
    var Allheight = document.body.offsetHeight || document.documentElement.clientHeight;
    var DefaultOption = {
		left:0,
		top:0,
		width:Lwidth,
		height:Lheight,
		fontColor:'#990033',
		borderColor:'#CCCCFF'
    };
	option = option||DefaultOption;
	var iframe_id = "xxx_iframe";
	var div_id = "xxx_div";
	var _iframe = document.getElementById(iframe_id);
	var _div = document.getElementById(div_id);
	if(_iframe&&_div){
		_iframe.style.display = "block";
		_div.style.display = "block";
	} else {
		_iframe = document.createElement("iframe");
		_iframe.id = iframe_id;
		_iframe.frameborder = "0px";
		_iframe.style.width = (Allwidth-25)+"px";
		_iframe.style.height = (Allheight-25)+"px";
		_iframe.scrolling = "no";
		_iframe.style.left=MarginLeft+"px";
		_iframe.style.top=MarginTop+"px";
		_iframe.src="about:blank";
		_iframe.style.filter="alpha(opacity=0)";
		_iframe.style.zIndex = 99;
		_iframe.style.position="absolute";
		_iframe.style.border='none';
		_iframe.style.overflow = "hidden";
		document.body.appendChild(_iframe);
		
		_div = document.createElement("div");
		_div.id = div_id;
		_div.style.position="absolute";
		_div.style.left= (option.left||DefaultOption.left) + "px";
		_div.style.top = (option.top||DefaultOption.top) +"px";
		_div.style.width = (option.width||DefaultOption.width);
		//_div.style.height = (option.height||DefaultOption.height);
		_div.style.height = "200%";

		_div.style.border = "1px solid "+(option.borderColor||DefaultOption.borderColor);
		_div.style.zIndex = 99;
		_div.style.backgroundColor = "#999999";
		_div.style.opacity = 0.5;
		//_div.style.filter = alpha(opacity=50);

		var fontColor = option.fontColor||DefaultOption.fontColor;
		var m_top = ((option.height||DefaultOption.height)-39)/2-2;
		var html="<table style='z-index:90;margin:0 auto; width:100%; margin-top:50px;' border='0'></table>";
		_div.innerHTML = html;
		document.body.appendChild(_div);
	}
}